{% extends "base.html" %}{% load i18n crm_tags %} {% block title %}{{ ticket.number }}{% endblock %} {% block content %}

{{ ticket.number }}, {% blocktranslate trimmed with date=ticket.created_at|date:"j M Y, H:i" %}opened {{ date }}{% endblocktranslate %}

{{ ticket.title }}

{{ ticket.get_urgency_display }} {{ ticket.get_status_display }} {% if ticket.is_escalated %}{% translate "Escalated" %}{% endif %} {% if ticket.crisis %}{% translate "Caller in danger" %}{% endif %}
{{ ticket.contact.name }} {% translate "Log a call" %}
{% if ticket.crisis %}
{% if ticket.crisis_waiting %} {% translate "Caller in danger. No one has taken charge yet." %}

{% translate "Call the caller back now if the call ended, and decide with the agent what happens next: a pastor, a visit, the police or a health worker." %}

{% if user.is_supervisor %}
{% csrf_token %}
{% endif %} {% else %} {% blocktranslate trimmed with name=ticket.crisis_handled_by.display_name|default:"—" when=ticket.crisis_handled_at|when %}Caller in danger: {{ name }} took charge, {{ when }}.{% endblocktranslate %} {% endif %} {% if user.is_supervisor %}

{% translate "Open a pastoral care case" %}

{% endif %}
{% endif %} {% if ticket.is_escalated %}
{% if ticket.escalated_to %}{% blocktranslate trimmed with name=ticket.escalated_to.display_name %}Escalated to {{ name }}{% endblocktranslate %}{% else %}{% translate "Escalated to all supervisors and administrators" %}{% endif %} {% blocktranslate trimmed with name=ticket.escalated_by.display_name|default:"—" when=ticket.escalated_at|when %}by {{ name }}, {{ when }}{% endblocktranslate %}

{{ ticket.escalation_reason }}

{% endif %}

{% translate "The call" %}

{{ call.called_at|date:"j M Y, H:i" }}
{{ call.get_purpose_display }} {{ call.get_direction_display }}, {{ call.get_outcome_display|lower }}{% if call.duration_minutes %}, {% blocktranslate trimmed with m=call.duration_minutes %}{{ m }} min{% endblocktranslate %}{% endif %}{% if call.agent %}, {{ call.agent.display_name }}{% endif %}
{% if call.summary %}

{{ call.summary }}

{% endif %} {% if prayers or follow_ups or donations %}
{% for pr in prayers %}
{% blocktranslate trimmed with category=pr.get_category_display|lower %}Prayer, {{ category }}:{% endblocktranslate %} {% if pr|can_view:user %}{{ pr.request }}{% else %}{% translate "Confidential. A supervisor can see it." %}{% endif %}
{% endfor %} {% for fu in follow_ups %}
{% translate "Follow-up:" %}{{ fu.label }} ({{ fu.get_status_display|lower }}, {{ fu.due_date|date:"j M" }}{% if fu.assigned_to %}, {{ fu.assigned_to.display_name }}{% endif %})
{% endfor %} {% for g in donations %} {% translate "Gift" %}:{{ g.amount|tzs }}{% if g.is_cancelled %} ({% translate "cancelled" %}){% endif %} {{ g.purpose_label }}, {{ g.medium_label }}{% if g.reference %}, {{ g.reference }}{% endif %}
{% endfor %}
{% endif %}

{% translate "History" %}

    {% for u in updates %}
  1. {{ u.get_kind_display }} {{ u.created_at|when }}{% if u.author %}, {{ u.author.display_name }}{% endif %}
    {% if u.text %}

    {{ u.text }}

    {% endif %}
  2. {% endfor %}
{% endblock %}